package jia.game;

import jia.game.GenericFlags;
import org.apache.log4j.Logger;

import javax.swing.*;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: stelle
 * Date: Jan 13, 2006
 * Time: 11:06:00 AM
 * To change this template use File | Settings | File Templates.
 */
public class DialoguePanel extends JTextPane {
    private static final Logger log = Logger.getLogger(DialoguePanel.class);
    
    
    public DialoguePanel() {
        super();
        this.setSize(740, 230);
        this.setVisible(true);
        this.setBackground(ComponentUtils.getGlobalBackgroundColor());
        this.setForeground(Color.WHITE);
        this.setText("Content");
        this.setFocusable(false);
        
        this.setFont(ComponentUtils.getGlobalFont());
        
        
        this.setMargin(new Insets(10, 10, 10, 10));
    }
    
    
    //====================================================
    /**
     * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
     */
    protected void paintComponent(Graphics arg0) {
        Graphics2D g = (Graphics2D) arg0;
        if (g == null) {
            if (GenericFlags.debugMessages) {
                log.debug("Graphics object is null");
            }
        } else {
            if (GenericFlags.debugMessages) {
                log.debug("Set rendering hints.");
            }
            g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        }
        super.paintComponent(arg0);
    }
}
